#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	string s;
	getline(cin, s);
	int cnt = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == ' ') {
			if (cnt)	cout << cnt << " ";
			else continue;
			cnt = 0;
		} else cnt++;
	}
	cout << cnt - 1;
	return 0;
}
